<meta charset="UTF-8">
<input type="button" value="关闭" onclick="closeWin()" />
<script>
    function closeWin(){
        if(confirm("您真的确定要离开这个页面吗？")){
            close();
        }
    }
</script>